It is recommended that you use the Option Explicit statement in all HyperPoint scripts to force explicit declaration of all variables in a file. This statement can also help expose uninitialized variable errors in your scripts. VBScript requires that Option Explicit be the first statement in a script.
CVS services (with the keyword ENABLE_SCRIPTING enabled) combine each HyperPoint’s script into one script in alphabetical order by the HyperPoint’s Long Point ID.
The following behavior is supported:
If enabled, the SCRIPTING_OPTION_EXPLICIT keyword forces Option Explicit for all hyperpoints in the service, enabling Option Explicit and allowing the scripts to load, even if HyperPoint scripts have Option Explicit specified.
Before enabling this option, you should thoroughly test all scripts in a test environment, as Option Explicit only catches undeclared variables while the script is executing. If there is an undeclared variable in an error handler, it may not be caught until the error occurs. Additionally, since undeclared variables are a runtime error, "On Error Resume Next" may hide undeclared variables.
If the HSS has SCRIPTING_OPTION_EXPLICIT enabled, the PNT script editor will enforce it in simulation mode. The read-only script display will also show "Option Explicit" so the script writer realizes why "undeclared variable" errors are reported even if Option Explicit is not specified. There is also a comment stating why Option Explicit is displayed.
See ENABLE_SCRIPTING and SCRIPTING_OPTION_EXPLICIT in the Service Configuration Keywords section for more information.